import request from '@/utils/request';

/**
 * 新增供销合同
 * @hmContractId 数据id
 * @sell 合同数据集合
 */

export const addSell = (data?: { hmContractId?: string; sell?: any[] }) => {
  return request({
    url: '/electroniccommerce/contract/addSell',
    method: 'post',
    data: data
  });
};

/**
 * 新增破价合同
 * @hmContractId 数据id
 * @discount 合同数据集合
 */

export const addDiscount = (data?: { hmContractId?: string; discount?: any[] }) => {
  return request({
    url: '/electroniccommerce/contract/addDiscount',
    method: 'post',
    data: data
  });
};


/**
 * 新增破价合同和供销合同
 * @hmContractId 数据id
 * @contractDiscountList 破价合同数据集合
 * @contractSellList 供货合同数据集合
 */

export const contractAdd = (data?: { id?: string; contractDiscountList?: any[], contractSellList?: any[] }) => {
    return request({
      url: '/electroniccommerce/contract/add',
      method: 'post',
      data: data
    });
  };